#ifndef __TOURGL_H__
#define __TOURGL_H__

#ifdef __APPLE__
#include <GLUT/Glut.h>
#else
#include <GL/glut.h>
#endif
#include "PieceGL.h"

class TourGL : public PieceGL {
	private :
	static int numVerts;
	static GLfloat Verts [][3];
	static GLfloat VertNorms [][3] ;
	static int Faces [][3] ;
	static int numFaces ;
	
	static bool dessine ;
	static int list ;

	static int nbInst ;	
	
	public :
	virtual int & getl(){return list;}
	virtual bool & isd(){return dessine;}
	virtual int & getnf(){ return numFaces;}
	virtual int & getnv(){ return numVerts;}
	virtual GLfloat* getv(){return (GLfloat*)Verts;}
	virtual int* getf(){return (int*)Faces;}
	virtual GLfloat* getvn(){return (GLfloat*)VertNorms;}
	
	TourGL (Piece * parent = NULL, bool couleur = false) : PieceGL(parent, couleur, this) {
		nbInst++;
	}
	~TourGL () {
		nbInst--;
		if (!nbInst)
			glDeleteLists(list, 1);
		dessine = false ;

	}

};
#endif
